This will allow subscribers to batch-load everything they
need beforehand, instead of loading everything piecemeal
on a per-line basis when WatchlistEditorBuildRemoveLine
is called.
Change-Id: I362e25b585921d755d6564955ac685971386f29b
instead.
=== New features in 1.24 ===
instead.
=== New features in 1.24 ===
+* Added new hook WatchlistEditorBeforeFormRender, allowing subscribers to
+ manipulate the list of pages and/or preload lots of data at once.
* Added new argument &$link in hook WatchlistEditorBuildRemoveLine, allowing the
link to the title to be changed.
* Added a new hook, "WhatLinksHereProps", to allow extensions to annotate
* Added new argument &$link in hook WatchlistEditorBuildRemoveLine, allowing the
link to the title to be changed.
* Added a new hook, "WhatLinksHereProps", to allow extensions to annotate
$user: user that watched
$page: WikiPage object watched
$user: user that watched
$page: WikiPage object watched
+'WatchlistEditorBeforeFormRender': Before building the Special:EditWatchlist
+form, used to manipulate the list of pages or preload data based on that list.
+&$watchlistInfo: array of watchlisted pages in
+ [namespaceId => ['title1' => 1, 'title2' => 1]] format
+
'WatchlistEditorBuildRemoveLine': when building remove lines in
Special:Watchlist/edit.
&$tools: array of extra links
'WatchlistEditorBuildRemoveLine': when building remove lines in
Special:Watchlist/edit.
&$tools: array of extra links
$fields = array();
$count = 0;
$fields = array();
$count = 0;
- foreach ( $this->getWatchlistInfo() as $namespace => $pages ) {
+ // Allow subscribers to manipulate the list of watched pages (or use it
+ // to preload lots of details at once)
+ $watchlistInfo = $this->getWatchlistInfo();
+ wfRunHooks(
+ 'WatchlistEditorBeforeFormRender',
+ array( &$watchlistInfo )
+ );
+
+ foreach ( $watchlistInfo as $namespace => $pages ) {
$options = array();
foreach ( array_keys( $pages ) as $dbkey ) {
$options = array();
foreach ( array_keys( $pages ) as $dbkey ) {